package day1.zy3;

import java.util.HashSet;
import java.util.Set;

public class SetTest {
    public static void main(String[] args) {
        Set s = new HashSet();
        s.add("cat");
        s.add("pig");
        for (Object object:s){
            String a= (String) object;
            System.out.println(a);
        }
        s.contains("dog");
        System.out.println(s.contains("dog"));
        s.remove("cat");
        System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
        for (Object object:s){
            String a= (String) object;
            System.out.println(a);
        }
    }
}
